<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!--引入外部文件-->
    <script src="./node_modules/vue/dist/vue.js" ></script>
</head>

<body>
<div id="app">
    <div style="background-color:red;width: 100px;height: 100px" @click="myClick('div')">
        <input type="button" value="点我" @click.stop="myClick('btn')">
        <!--<input type="button" value="点我" @click="myClick1(btn)">-->

    </div>
    <a href.prevent="https://www.baidu.com">跳转</a>
    <br>
    <input type="text" placeholder="输入搜索内容"  @keyup.enter="myKeyup('this.value')">
</div>
<br>

</body>

<script>

    var vm = new Vue({
        el:"#app",
        methods:{
            myClick(val){
                alert(val)
            },
            myKeyup(val){
                alert(val)
            }
        }
    })

</script>

</html>